#pragma once

#include "LogEvent.h"
#include "Logger.h"
#include "LogManager.h"

#define BAMBOO_LOG_LEVEL(logger, level, content) \
    if (logger->getLevel() <= level) \
        bamboo::LogEventWrap(bamboo::LogEvent::ptr(new bamboo::LogEvent(logger, level, \
                __FILE__, __LINE__, 0, 0/*bamboo::GetThreadId()*/, \
                /*bamboo::GetFiberId()*/0, time(0), "none"/*sylar::Thread::GetName()*/, content)));

#define LOG_INFO(logger, content) BAMBOO_LOG_LEVEL(logger, bamboo::LogLevel::INFO, content)
#define LOG_DEBUG(logger, content) BAMBOO_LOG_LEVEL(logger, bamboo::LogLevel::DEBUG, content)
#define LOG_WARN(logger, content) BAMBOO_LOG_LEVEL(logger, bamboo::LogLevel::WARN, content)
#define LOG_ERROR(logger, content) BAMBOO_LOG_LEVEL(logger, bamboo::LogLevel::ERROR, content)
#define LOG_FATAL(logger, content) BAMBOO_LOG_LEVEL(logger, bamboo::LogLevel::FATAL, content)

#define LOG_NAME(name) bamboo::LogMgr::GetInstance()->getLogger(name)

#define LOG_ROOT() LOG_NAME("root")

namespace bamboo {

};